<template>
	<view class="container addbatch">
		<myhead :title="mytitle"></myhead>
		<view class="mian">
			<view class="title">
				<view class="box first" :class="{active:step == 1}">
					<view class="index">
						1
					</view>
					<view class="text">
						选择批次货主
					</view>
				</view>
				<view class="circle">
					
				</view>
				<view class="box second" :class="{active:step == 2}">
					<view class="index">
						2
					</view>
					<view class="text">
						选择批次货品
					</view>
				</view>
			</view>
			<view class="info">
				<view class="box first" v-show="step == 1">
					<view class="item">
						<view class="left">
							选择货主
						</view>
						<view class="right">
							<text>默认第一个</text>
							<image src="../../static/images/blackright.png" class="routericon"></image>
						</view>
					</view>
					<view class="item">
						<view class="left">
							批次号
						</view>
						<view class="right">
							<text>保存之后自动生成</text>
						</view>
					</view>
				</view>
				<view class="box second" v-show="step == 2">
					<view class="item" @tap = "change">
						<view class="left">
							货主名字
						</view>
						<view class="right">
							<text>点击修改</text>
							<image src="../../static/images/blackright.png" class="routericon"></image>
						</view>
					</view>
					<view class="item">
						<view class="left">
							货品列表
						</view>
						<view class="right addbtn">
							<text>+添加新货品</text>
						</view>
					</view>
					<view class="productlist">
						<view class="productitem" v-for="(item,index) in 4" :key = "index">
							<view class="left">
								<view class="name">
									八爪鱼
								</view>
								<view class="type">
									规格：35元/斤
								</view>
							</view>
							<view class="right">
								 <checkbox class="mycheck" style="transform:scale(0.7)"/>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="btn" @tap = "nextstep" v-show="step == 1">
				下一步
			</view>
		</view>
		<view class="footer" v-show="step == 2">
			<view class="text">
				<text>已选</text>
				<text style="color: #DD524D;">1</text>
				<text>种商品</text>
			</view>
			<view class="upload">
				提交
			</view>
		</view>
	</view>
</template>

<script>
	import myhead from "../../components/header/header.vue"
	export default {
		data() {
			return {
				mytitle:'添加批次',
				step:1
			};
		},
		methods:{
			nextstep(){
				this.step = 2
			},
			change(){
				this.step = 1
			}
		},
		components:{
			myhead
		}
	}
</script>

<style lang="scss" scoped>
.addbatch{
	color: black;
	display: flex;
	flex-direction: column;
	.mian{
		flex: 1;
		width: 100%;
		background-color: #EEEEEE;
		.title{
			display: flex;
			align-items: center;
			overflow: hidden;
			background-color: #FFFFFF;
			.circle{
				height: 100rpx;
				width: 100rpx;
				border-top:10rpx solid #EEEEEE;
				border-right:10rpx solid #EEEEEE;
				box-sizing: border-box;
				transform: rotate(45deg);
				background-color: #FFFFFF;
			}
			.box{
				height: 100rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				.index{
					width: 45rpx;
					height: 45rpx;				
					line-height: 45rpx;
					text-align: center;
					font-size: 30rpx;
					border-radius: 50%;
					margin-right: 15rpx;				
					color: gray;
					background-color: #FFFFFF;
					border: 2rpx solid gray;
				}
				.text{
					font-size: 30rpx;
					white-space: nowrap;
					color: gray;
				}
				&.active{
					.index{
						background-color: #353766;
						color: #F1F1F1;
						border: 2rpx solid #353766;
					}
					.text{
						color: #353766;
					}
				}
				&.first{
					flex: 4.5;
				}
				&.second{
					flex: 5.5;
				}
			}
		}
		.info{
			box-sizing: border-box;
			padding: 15rpx;
			.box{
				.item{
					border-radius: 16rpx;		
					padding: 35rpx 10rpx;
					background-color: #FFFFFF;
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin-bottom: 10rpx;
					box-sizing: border-box;
					.left{
						font-size: 30rpx;
					}
					.right{
						display: flex;
						align-items: center;
						font-size: 20rpx;
						color: gray;
						.routericon{
							margin-left: 15rpx;
						}
					}
				}
				.productlist{
					.productitem{
						padding: 20rpx 30rpx;
						display: flex;
						align-items: center;
						justify-content: space-between;
						font-size: 28rpx;
						background-color: #FFFFFF;
						.left{
							.type{
								font-size: 24rpx;
								color: gray;
							}
						}
					}
				}
				&.second{
					.right{
						&.addbtn{
							border: 2rpx solid #34C758;
							padding: 10rpx 20rpx;
							align-items: center;
							border-radius: 20rpx;
							font-size: 20rpx;
							color: #34C758;
						}
						
					}
				}
			}
		}
		.btn{
			width: 50%;
			margin: 0 auto;
			background-color: #353766;
			text-align: center;
			line-height: 70rpx;
			font-size: 30rpx;
			white-space: nowrap;
			color: #FFFFFF;
			border-radius: 28rpx;
		}
	}
	.footer{
		display: flex;
		padding: 20rpx 30rpx;
		align-items: center;
		justify-content: space-between;
		.text{
			font-size: 30rpx;
		}
		.upload{
			width: 35%;
			background-color: #353766;
			text-align: center;
			line-height: 60rpx;
			font-size: 30rpx;
			white-space: nowrap;
			color: #FFFFFF;
			border-radius: 28rpx;
		}
	}
}
</style>
